package com.foreknow.demo19;

public class ExceptionDemo {
    public static void compute(int a) throws MyException {
        System.out.println(a);
        if(a>10){
            throw new MyException("error");
        }
        System.out.println("normal exit");
    }

    public static void main(String[] args) {
        try {
            ExceptionDemo.compute(12);
        } catch (MyException e) {
            System.out.println(e.getMessage());
        }
    }
}